package 设计模式.观察者模式.improve;

public class Client {
    public static void main(String[] args) {
        WeatherData weatherData = new WeatherData();
        //创建观察者
        CurrentConditions currentConditions = new CurrentConditions();
        //注册到weatherData中
        weatherData.registerObserver(currentConditions);
        weatherData.registerObserver(new BaiduSite());
        //测试
        System.out.println("通知各个注册的观察者，看看信息");
        weatherData.setData(10, 100, 30.3f);
        //删除
        weatherData.removeObserver(currentConditions);
        weatherData.setData(15, 95, 25.5f);
    }
}
